import Vue from 'vue'
import App from './App.vue'
import http from "./api/index"
import router from './router'
import store from './store'
import Directive from './utils/directive'
import './style/init.scss';
import config from "./config"
import mixins from "@/mixins/common"

import {
  message
} from '@/utils/resetMessage';

import md5 from "js-md5";
// 基础组件的自动化全局注册
const files = require.context('./components/auto-register', false, /\.vue$/)
files.keys().forEach(fileName => {
  const componentName = fileName.split('/').pop().replace('_', '-').replace('.vue', '');
  Vue.component(componentName, files(fileName).default)
});


//全局http请求
Vue.prototype.$http = http
Vue.prototype.$md5 = md5
Vue.prototype.$message = message;
//公共配置
Vue.prototype.$config = config
Vue.use(mixins)
Vue.config.productionTip = false

new Vue({
  render: h => h(App),
  router,
  store,
  Directive
}).$mount('#app')